<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script>
function addorder()
{
	$('#addstorageform').modal('show');	
}
</script>
<style>
	.style1{background-color:#30B924}
	.style3{
	background-color:#FF8000;}
	.style2,.style4{
		background-color:#D4D4D4;
	}
	.stdtable tr td{
	color:#000000 !important;
	}
	.stdtable tr td a:visited{color:#999999;}
	.stdtable tr td a:link{color:#000000;}
	.stdtable tr td a:hover{color:#000033;
	text-decoration:underline}
	
</style>
<title>Ebay消息管理</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">Ebay消息管理</h1>
      <span class="pagedesc"></span>
       <div class="menulist">
        <ul class="profile_summary">
          <li style="display:none;"> <a href="javascript:void(0)" onClick="addorder()" class=""><span>增加新项目</span></a></li>
          <li><a href="/EbayMessage/importMsg" target="_blank"><span>获取最新平台消息</span></a></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <!--搜索栏-->
           <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
    <form class="stdform stdform2" method="get" action="/EbayMessage/index">
      <div class="tableoptions"><select name="shop_id" id="shop_id"  class="selection select2_group" style="width:150px;" >
        <option value="" >店铺</option>
        {{foreach from=$d_shop item=li key=key}}
              <option value="{{$li.id}}" {{if $shop_id==$li.id}} selected{{/if}}>{{$li.name}}</option>
        {{/foreach}}
        </select>
        <select name="messagetype" class="selection" style="width:150px;display:none">
            <option value=""  selected>-消息类型-</option>
            <option value="ResponseToASQQuestion" {{if $messagetype=='ResponseToASQQuestion'}} selected{{/if}}>ResponseToASQQuestion</option>
            <option value="AskSellerQuestion" {{if $messagetype=='AskSellerQuestion'}} selected{{/if}}>AskSellerQuestion</option>
            <option value="ContactTransactionPartner" {{if $messagetype=='ContactTransactionPartner'}} selected{{/if}}>ContactTransactionPartner</option>
            <option value="tips" {{if $messagetype=='tips'}} selected{{/if}}>tips</option>
        </select> 
        <select name="message_state" class="selection" style="width:150px;">
            <option value=""  selected>-消息状态-</option>
            <option value="2" {{if $message_state=='2'}} selected{{/if}}>未回复</option>
            <option value="1" {{if $message_state=='1'}} selected{{/if}}>已回复</option>
        </select>       
        买家：<input type="text" name="customer" id="customer" value="{{$customer}}"  style="width:120px;">&nbsp;消息ID:
       <input type="text" name="messageid" id="messageid" class="width100" value="{{$messageid}}" placeholder="消息ID" />&nbsp;接收时段:
        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> -
        <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> 
        <button class="btn btn_orange btn_search radius50">Search</button>
      </div>
    </form>
    <!--搜索栏结束-->

             <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
          
            <thead>
              <tr>
               <th class="head1"><input name="allchk" id="allchk" type="checkbox" onClick="allSelect('ppid[]')"></th>
                <th class="head1" width="120">买家/接收帐号/本地店铺名</th>
                <th class="head1">主题</th>
                <th class="head1">消息类型</th>
                <th class="head1" width="110">对应订单编号</th>
                <th class="head1" width="50">负责人</th>
                <th class="head1" width="50">状态</th>
                <th class="head1" width="130">Ebay接收时间</th>
                <th class="head1" width="80">导入日期</th>
              </tr>
            </thead>
          
             {{foreach from=$orderlist item=detail key=key}}
                <tr class="style{{$detail.msg_flag}}">
                 <td><input name="ppid[]" type="checkbox" value="{{$detail.id}}"></td>
                <td>{{$detail.Sender}}<br>{{$detail.SendToName}}<br>{{$detail.shop_name}}</td>
                <td style="font-size:13px;"><a href="/ebayMessage/ajaxbutton?op=messageDetail&id={{$detail.id}}" target="_blank">{{$detail.Subject}}</a></td>
                <td>{{$detail.MessageType}}</td>
                <td><a href="/orderlist/orderlist?kw={{$detail.order_sn}}" target="_blank">{{$detail.order_sn}}</a></td>
                <td>{{$detail.shop_owner}}&nbsp;</td>
                <td>
        {{if $detail.Replied eq 1}}<strong>已回复</strong><br>
            {{if $detail.update_online == 1}}
                <strong style="color:red;">已同步</strong>
            {{else}}
                {{if $detail.update_online == 2}}<strong style="color:red;" title="{{$detail.ret_msg}}">同步失败{{/if}}
            {{/if}}
            	
{{else}}
    {{if $detail.msg_flag gt 0}}{{$msg_flag[$detail['msg_flag']]}}{{else}}<strong style="color:#FFCC00;">未回复</strong>{{/if}}
{{/if}}</td>
                <td>{{$detail.ReceiveDate|substr:0:16}}<br><span style="font-size:12px;">消息ID：{{$detail.MessageID}}</span></td>
                <td>{{$detail.ImportTime|substr:5:11}}</td>
               </tr>
              {{/foreach}}
            {{if $orderlist eq null}}
            	<tr><td colspan="9" align="center" bgcolor="#fff">暂无数据，请尝试更改查询条件试试吧！</td>
           	    </tr> 
            {{/if}}
          </table>
          
        <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
      </div></div>
</body>
</html>